import com.ruoyi.project.cyq.task.postpone.domain.PostPone;
import com.ruoyi.project.cyq.task.postpone.mapper.PostPoneMapper;
import com.ruoyi.project.cyq.task.task.domain.Leave;
import com.ruoyi.project.cyq.task.task.domain.Status;
import com.ruoyi.project.cyq.task.task.domain.Task;
import com.ruoyi.project.cyq.task.task.mapper.LeaveMapper;
import com.ruoyi.project.cyq.task.task.mapper.StatusMapper;
import com.ruoyi.project.cyq.task.task.mapper.TaskMapper;
import com.ruoyi.project.system.user.domain.User;
import com.ruoyi.project.system.user.mapper.UserMapper;
import org.apache.poi.hssf.record.DVALRecord;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = com.ruoyi.RuoYiApplication.class)
public class demo01 {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private TaskMapper taskMapper;

    @Autowired
    private LeaveMapper leaveMapper;

    @Autowired
    private StatusMapper statusMapper;


    @Autowired
    private PostPoneMapper postPoneMapper;


    @Test
    public void demo01(){
        User user= new User();
        List<User> users = userMapper.selectUserList(user);
        System.out.println(users);
    }

    @Test
    public void demo02(){
        Task task = new Task();
        task.setTaskTitle("简单任务");
        task.setTaskStatus(1);
        int i = taskMapper.insertTask(task);
        System.out.println(i);
    }

    @Test
    public void demo03(){

        Task task = taskMapper.selectTaskById(1);
        System.out.println(task);
    }


    @Test
    public void demo04(){
        Leave leave = new Leave();
        leave.setTaskLeave(1);
        System.out.println(leaveMapper.selectLeaveList(leave));
    }

    @Test
    public void demo05(){
        System.out.println(statusMapper.selectStatusList(new Status()));
    }

    @Test
    public void demo06(){
        System.out.println(taskMapper.selectTaskList1(new Task()));
    }

    @Test
    public void demo07(){
        System.out.println(postPoneMapper.selectPostPoneList(new PostPone()));
    }

    @Test
    public void demo08(){
        System.out.println(taskMapper.selectAllTaskTitle());
    }

    @Test
    public void demo09(){
        System.out.println(taskMapper.selectTaskByTaskTitle("简单任务"));

    }


}
